'use strict';

angular.module('app')
  .config([
    '$stateProvider',
    '$urlRouterProvider',
    function($stateProvider, $urlRouterProvider) {
      $stateProvider.state('main', {
          url: '/main',
          templateUrl: 'view/main.html',
          controller: 'mainCtrl'
        })
        .state('search', {
          url: '/search',
          templateUrl: 'view/search.html',
          controller: 'searchCtrl'
        })
        .state('position', {
          url: '/position/:id',
          // params:{"id":null},
          templateUrl: 'view/position.html',
          controller: 'positionCtrl'
        })
        .state('company', {
          url: '/company/:id',
          templateUrl: 'view/company.html',
          controller: 'companyCtrl'
        })
        .state('login', {
          url: '/login',
          templateUrl: 'view/login.html',
          controller: 'loginCtrl'
        })
        .state('register', {
          url: '/register',
          templateUrl: 'view/register.html',
          controller: 'registerCtrl'
        })
        .state('my', {
          url: '/my',
          templateUrl: 'view/my.html',
          controller: 'myCtrl'
        })
        .state('myFavorite', {
          url: '/myFavorite/:id',
          templateUrl: 'view/myFavorite.html',
          controller: 'myFavoriteCtrl'
        })
        .state('myPost', {
          url: '/myPost/:id',
          templateUrl: 'view/myPost.html',
          controller: 'myPostCtrl'
        });

      $urlRouterProvider.otherwise('main');

    }
  ]);
